package com.dubbo.cp.provider.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.dubbo.cp.IService.UserService;
import com.dubbo.cp.entity.UserEntity;
import com.dubbo.cp.provider.mapper.UserMapper;

@Service
public class UserServiceImpl implements UserService{
	@Autowired
	UserMapper userMapper;
	
	@Override
	public UserEntity findUserByUserid(int id) {
		// TODO Auto-generated method stub
		
		return userMapper.findUserByUserid(id);
	}

	@SuppressWarnings("null")
	@Override
	public void insertUserEntity(String username, String password) {
		UserEntity userEntity = null;
		userEntity.setUsername(username);
		userEntity.setPassword(password);
		 userMapper.insertUserEntity(userEntity);
		
	}

	@Override
	public void deleteUserEntity(int id) {
		// TODO Auto-generated method stub
		userMapper.deleteById(id);
	}

	@Override
	public UserEntity getUser(String username, String password) {
		// TODO Auto-generated method stub
		return userMapper.getUser(username,password);
	}

	@Override
	public List<UserEntity> getUserByPage(int start, int size) {
		// TODO Auto-generated method stub
		return userMapper.getUserByPage(start, size);
	}

	@Override
	public List<UserEntity> getUserList() {
		// TODO Auto-generated method stub
		return userMapper.getUserList();
	}

	@Override
	public void updateUserEntity(UserEntity userEntity) {
		// TODO Auto-generated method stub
		userMapper.updateUserEntity(userEntity);
	}

	@Override
	public void InsertUserEntity1(UserEntity userEntity) {
		// TODO Auto-generated method stub
		userMapper.insertUserEntity1(userEntity);
	}

	

	
}
